package com.yic.module.device.dal.mysql.inspectionDeviceEntry;

import java.util.*;

import com.yic.framework.common.pojo.PageResult;
import com.yic.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yic.framework.mybatis.core.mapper.BaseMapperX;
import com.yic.module.device.dal.dataobject.inspectionDeviceEntry.InspectionDeviceEntryDO;
import org.apache.ibatis.annotations.Mapper;
import com.yic.module.device.controller.admin.inspectionDeviceEntry.vo.*;

/**
 * 设备与检查项关联 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface InspectionDeviceEntryMapper extends BaseMapperX<InspectionDeviceEntryDO> {

    default PageResult<InspectionDeviceEntryDO> selectPage(InspectionDeviceEntryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InspectionDeviceEntryDO>()
                .eqIfPresent(InspectionDeviceEntryDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(InspectionDeviceEntryDO::getEntryId, reqVO.getEntryId())
                .betweenIfPresent(InspectionDeviceEntryDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(InspectionDeviceEntryDO::getId));
    }

    default List<InspectionDeviceEntryDO> selectList(InspectionDeviceEntryExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<InspectionDeviceEntryDO>()
                .eqIfPresent(InspectionDeviceEntryDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(InspectionDeviceEntryDO::getEntryId, reqVO.getEntryId())
                .betweenIfPresent(InspectionDeviceEntryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InspectionDeviceEntryDO::getId));
    }

}
